package com.example.demoribbon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Auther Created by l.wang on 2019/2/27.
 */
@RestController
public class RibbonController {

    @Autowired
    private RestTemplate restTemplate;


    @GetMapping("/ribbon/{id}")
    public String ribbon(@PathVariable String id){
        return restTemplate.getForObject("http://user/getUser/"+id, String.class);
    }
}
